package com.yangjie.common.dao.criteria;

import java.util.LinkedList;
import java.util.List;


public class QueryCriteria {
	public static final String LOGIC_AND = "and";
	public static final String LOGIC_OR = "or";
	
	private String criteriaRelation = LOGIC_AND;
	
	private List<CriteriaExpressionIF> critiriaExpressions = new LinkedList<CriteriaExpressionIF>();
	private List<OrderByExpression> orderByExpressions = new LinkedList<OrderByExpression>();
	
	public void clearOrder() {
		orderByExpressions.clear();
	}
	public void clear() {
		critiriaExpressions.clear();
		orderByExpressions.clear();
	}
	public void addOrderByExpression(OrderByExpression orderByExpression) {
		orderByExpressions.add(orderByExpression);
	}

	public List<OrderByExpression> getOrderByExpressions() {
		return orderByExpressions;
	}

	public String getCriteriaRelation() {
		return criteriaRelation;
	}

	public void setCriteriaRelation(String criteriaRelation) {
		this.criteriaRelation = criteriaRelation;
	}

	public List<CriteriaExpressionIF> getCritiriaExpressions() {
		return critiriaExpressions;
	}


	
	public void addExpr(CriteriaExpressionIF expr) {
		critiriaExpressions.add(expr);
	}
	
	
}
